import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'


const urlConfig = {
  '消息列表查询接口':{ url: '/msg/mgr/queryMsgList', method:'post'},// parentId
  '弹出消息通知':{ url: '/msg/mgr/disNotice', method:'post'},//  legalPhone

}

const actionType = {
  get: (url,parameter)=>{
    return getAction(url,parameter)
  },
  post:(url,parameter)=>{
    return postAction(url,parameter)
  },
  put:(url,parameter)=>{
    return putAction(url,parameter)
  },
  delete:(...args)=>{
    return deleteAction(...args)
  },
  http:(url,parameter,method)=>{
    return httpAction(url,parameter,method)
  },
}

export default (key,...args) =>{
  const tempConfig = urlConfig[key]
  return actionType[tempConfig.method](tempConfig.url,...args)
}

